package nacos_service1;

import nacos_service1.dao.CityDao;
import nacos_service1.pojo.City;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Author:zimmor
 * @Date: 2021/5/5 21:13
 * @Description
 * @version: 1.0.0
 */
@SpringBootApplication
@RefreshScope
@RestController
public class Service2Application {
    public static void main(String[] args) {
        SpringApplication.run(Service2Application.class);
    }
    @Autowired
    private CityDao cityDao;
    @GetMapping("/service1/config")
    public String getConfig() {
        return "hello";
    }

    @GetMapping("/city")
    public List<City> getCity() {
        List list = cityDao.findAll();
        System.out.println(list);
        return list;
    }
}
